using System;
using System.Collections.Generic;
using System.Text;

using System.Data;
using System.Data.Common;
using Husb.Data;
using Husb.DataUtil;
using Microsoft.Practices.EnterpriseLibrary.Data;
using Microsoft.Practices.EnterpriseLibrary.Caching;

using CentralOffice.MyTable.Data;

using ViewDiaryComCountTable = CentralOffice.MyTable.Data.DiaryDataSet.View_DiaryComCountDataTable;
using ViewDiaryComCountRow = CentralOffice.MyTable.Data.DiaryDataSet.View_DiaryComCountRow;
namespace CentralOffice.MyTable.DataAccess
{
    public class ViewDiaryComCoutAdapter : DataAccessAdapter<MyTable.Data.DiaryDataSet, ViewDiaryComCountTable, ViewDiaryComCountRow>
    {
        public ViewDiaryComCoutAdapter()
        {
            this.TableName = "View_DiaryComCount";           
            GetAllStoredProc = "ViewDiaryComCount_SelectViewDiaryComCountAll";           
            FindStoredProc = "ViewDiaryComCount_SelectViewDiaryComCountDynamic";
            GetByIdStoredProc = "ViewDiaryComCount_SelectViewDiaryComCount";
            GetPagedStoredProc = "ViewDiaryComCount_SelectViewDiaryComCountPaged";
            GetRowCountStoredProc = "ViewDiaryComCount_SelectViewDiaryComCountRowCount";
        }

        protected override void PopulateInsertParameters(Database db, DbCommand cmd)
        {
            db.AddInParameter(cmd, "Id", DbType.Guid, "Id", DataRowVersion.Current);
            db.AddInParameter(cmd, "UserId", DbType.AnsiString, "UserId", DataRowVersion.Current);
            db.AddInParameter(cmd, "UserName", DbType.AnsiString, "UserName", DataRowVersion.Current);
            db.AddInParameter(cmd, "DiaDate", DbType.DateTime, "DiaDate", DataRowVersion.Current);
            db.AddInParameter(cmd, "DiaType", DbType.AnsiString, "DiaType", DataRowVersion.Current);
            db.AddInParameter(cmd, "Subject", DbType.String, "Subject", DataRowVersion.Current);
            db.AddInParameter(cmd, "DiaContent", DbType.String, "DiaContent", DataRowVersion.Current);
            db.AddInParameter(cmd, "AttachMentSize", DbType.AnsiString, "AttachMentSize", DataRowVersion.Current);
            db.AddInParameter(cmd, "AttachMentName", DbType.String, "AttachMentName", DataRowVersion.Current);
            db.AddInParameter(cmd, "LastEditDate", DbType.DateTime, "LastEditDate", DataRowVersion.Current);
            db.AddInParameter(cmd, "LastCommentTime", DbType.DateTime, "LastCommentTime", DataRowVersion.Current);
            db.AddInParameter(cmd, "ToId", DbType.AnsiString, "ToId", DataRowVersion.Current);
            db.AddInParameter(cmd, "ToName", DbType.String, "ToName", DataRowVersion.Current);
            db.AddInParameter(cmd, "DeleteFlag", DbType.AnsiString, "DeleteFlag", DataRowVersion.Current);
            db.AddInParameter(cmd, "commentNum", DbType.Int32, "commentNum", DataRowVersion.Current);
        }
    }
}
